import { BaseShape } from "@/types/BaseShape";

import { IShapeProps } from "@/interface/IShape";

import { resetShapeList } from "@/store/events/shape.actions";

/* 核心列表 */
// export const shapeList = ref<Array<IShapeProps>>([]);

/* 多选 */
export const multipleSelectMode = ref(false);

/* 多选列表 */
export const selectSet = ref(new Set<string>());

/**
 * 注释: 往SET里面添加ID
 *
 * */
export const addIdInSet = (item: IShapeProps) => {
  if (!multipleSelectMode.value) {
    selectSet.value.clear();
  }
  selectSet.value.add(item.id);
  resetShapeList();
};

/* 当前激活的绘图 */
export const currentShape = ref<IShapeProps>(new BaseShape());
export const resetCurrentShape = () => {
  currentShape.value = new BaseShape();
};
/* 框选后的容器的样式 */
export const dragBoxConfig = ref({
  left: 0,
  top: 0,
  width: 0,
  height: 0,
  show: false
});

/* 鼠标方向:true水平,false:垂直 */
export const mouseDirection = ref(false);
export const copySet = ref();
